import { createRouter, createWebHistory } from 'vue-router'

export const homeRouter: any = [
  {
    path: '/home/index',
    name: 'index',
    component: () => import('../views/home/index/Index.vue'),
    meta: {
      title: '首页',
      icon: 'HomeFilled',
    }
  },
  {
    path: '/home/management',
    name: 'management',
    component: () => import('../views/home/management/Management.vue'),
    meta: {
      title: '大屏管理',
      icon: 'UserFilled',
    },
    children: [
      {
        path: '/home/management/Employment',
        name: 'Employment',
        component: () => import('../views/home/management/employment/Employment.vue'),
        meta: {
          title: '就业态势',
          icon: "Menu",
        }
      },
      {
        path: '/home/management/Intelligent',
        name: 'Intelligent',
        component: () => import('../views/home/management/Intelligent/Intelligent.vue'),

        meta: {
          title: '智能检测',
          icon: "Menu",
        }
      },
      {
        path: '/home/management/Security',
        name: 'Security',
        component: () => import('../views/home/management/Security/Security.vue'),

        meta: {
          title: '安防管理',
          icon: "Menu",
        }
      },
      {
        path: '/home/management/Equipment',
        name: 'Equipment',
        component: () => import('../views/home/management/Equipment/Equipment.vue'),

        meta: {
          title: '设备运维',
          icon: "Menu",
        }
      },
    ],
  },
  {
    path: '/home/point',
    name: 'point',
    component: () => import('../views/home/point/Point.vue'),
    meta: {
      title: '知识点',
      icon: 'Avatar',
    },
    children: [
      {
        path: '/home/point/keepalive',
        name: 'keepalive',
        component: () => import('../views/home/point/model/Keepalive.vue'),
        meta: {
          title: 'Keepalive',
          icon: 'Menu',
        },
      }
    ]
  },

  {
    path: '/home/Pagen',
    name: 'Pagen',
    component: () => import('../views/home/Pagen/Page.vue'),
    meta: {
      title: '页面管理',
      icon: "Checked",
    }
  },
  {
    path: '/home/graph',
    name: 'graph',
    component: () => import('../views/home/graph/graph.vue'),
    meta: {
      title: '图形图表',
      icon: "Histogram",
    },
    children: [
      {
        path: '/home/graph/model/map',
        name: 'map',
        component: () => import('../views/home/graph/model/map.vue'),
        meta: {
          title: '地图',
          icon: "Menu",
        },
        children: [
          {
            path: '/home/graph/model/map/map',
            name: 'Autonavi',
            component: () => import('../views/home/graph/model/map/Autonavi.vue'),
            meta: {
              title: '高德',
              icon: "Menu",
            },
          }
        ]
      },
    ]
  },
  {
    path: '/home/my',
    name: 'my',
    component: () => import('../views/home/my/My.vue'),
    meta: {
      title: '个人中心',
      icon: "HomeFilled",
    }
  },
]

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/login',
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('../views/Login.vue')
    },
    {
      path: '/home',
      name: 'home',
      component: () => import('../views/Home.vue'),
      children: homeRouter
    },
    {
      path: '/:pathMacth(.*)',
      name: '404',
      component: () => import('../views/Found.vue')
    },
  ]
})


export default router
